<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox-content">
                <div class="row">
                    <form  action="<?=url('mendian.setting/index')?>" id="form-create" method="post" class="form-horizontal" role="form"> 

                        <div class="form-group">
                            <label class="col-sm-3 control-label no-padding-right">商户名称：</label>
                            <div class="col-sm-9">
                                <input type="text"  value="<?=isset($detail->name)?$detail->name:''?>" placeholder="" id="name" name="name"  class="form-control" /> 
                            </div>
                        </div>
                        <link rel="stylesheet" type="text/css" href="/public/common/webuploader-0.1.5/webuploader.css">
                        <script type="text/javascript" src="/public/common/webuploader-0.1.5/webuploader.js"></script>



                        <div class="form-group">
                            <label class="col-sm-3 control-label no-padding-right">BANNER大图：</label>
                            <div class="col-sm-9 ">      

                                <div id="uploader-demo" style="max-width: 300px">
                                    <!--用来存放item-->
                                    <div id="bannerList" class="uploader-list">
                                        <?php if(isset($detail['banner'])){?>
                                        <div  class="file-item thumbnail"><img width="110" src="/attachs/uploads/<?=$detail['banner']?>"><input type="hidden" value="<?=$detail['banner']?>" name="banner" id="banner"></div>
                                        <?php }?>
                                    </div>
                                    <div id="bannerPicker">选择图片</div>
                                </div>

                                建议640 X 360
                            </div>
                        </div>    


                        <script>



                            var uploaderbanner = WebUploader.create({
                            auto: true,
                                    swf: '/public/admin/Widget/webuploader-0.1.5/Uploader.swf',
                                    server: '<?=url("upload.upload/index",['mdl'=>"setting_banner"])?>',
                                    pick: '#bannerPicker',
                                    resize : false,
                                    duplicate :true
                                    });
                            $(document).on('click', '.file-item', function(){
                            $(this).remove();
                            });
                        // 当有文件添加进来的时候
                            uploaderbanner.on('fileQueued', function(file) {
                            var $li = $(
                                    '<div id="' + file.id + '" class="file-item thumbnail">' +
                                    '<img>' +
                                    '<input type="hidden" value="" name="banner" id="banner">' +
                                    '<div class="info">' + file.name + '</div>' +
                                    '</div>'
                                    ),
                                    $img = $li.find('img');
                            // $list为容器jQuery实例
                            $("#bannerList").html($li);
                            // 创建缩略图
                            // 如果为非图片文件，可以不用调用此方法。
                            // thumbnailWidth x thumbnailHeight 为 100 x 100
                            uploaderbanner.makeThumb(file, function(error, src) {
                            if (error) {
                            $img.replaceWith('<span>不能预览</span>');
                            return;
                            }

                            $img.attr('src', src);
                            }, 100, 100);
                            });
                        // 文件上传过程中创建进度条实时显示。
                            uploaderbanner.on('uploadProgress', function(file, percentage) {
                            var $li = $('#' + file.id),
                                    $percent = $li.find('.progress span');
                            // 避免重复创建
                            if (!$percent.length) {
                            $percent = $('<p class="progress"><span></span></p>')
                                    .appendTo($li)
                                    .find('span');
                            }

                            $percent.css('width', percentage * 100 + '%');
                            });
                        // 文件上传成功，给item添加成功class, 用样式标记上传成功。
                            uploaderbanner.on('uploadSuccess', function(file, response) {
                            $('#' + file.id).addClass('upload-state-done');
                            $("#banner").val(response._raw);
                            });
                        // 文件上传失败，显示上传出错。
                            uploaderbanner.on('uploadError', function(file) {
                            var $li = $('#' + file.id),
                                    $error = $li.find('div.error');
                            // 避免重复创建
                            if (!$error.length) {
                            $error = $('<div class="error"></div>').appendTo($li);
                            }

                            $error.text('上传失败');
                            });
                        // 完成上传完了，成功或者失败，先删除进度条。
                            uploaderbanner.on('uploadComplete', function(file) {
                            $('#' + file.id).find('.progress').remove();
                            });</script>
                        <link rel="stylesheet" type="text/css" href="/public/common/webuploader-0.1.5/webuploader.css">
                        <script type="text/javascript" src="/public/common/webuploader-0.1.5/webuploader.js"></script>



                        <div class="form-group">
                            <label class="col-sm-3 control-label no-padding-right">LOGO：</label>
                            <div class="col-sm-9 ">      

                                <div id="uploader-demo" style="max-width: 300px">
                                    <!--用来存放item-->
                                    <div id="logoList" class="uploader-list">
                                        <?php if(isset($detail['logo'])){?>
                                        <div  class="file-item thumbnail"><img width="110" src="/attachs/uploads/<?=$detail['logo']?>"><input type="hidden" value="<?=$detail['logo']?>" name="logo" id="logo"></div>
                                        <?php }?>
                                    </div>
                                    <div id="logoPicker">选择图片</div>
                                </div>


                            </div>
                        </div>    


                        <script>



                            var uploaderlogo = WebUploader.create({
                            auto: true,
                                    swf: '/public/admin/Widget/webuploader-0.1.5/Uploader.swf',
                                    server: '<?=url("upload.upload/index",['mdl'=>"setting_logo"])?>',
                                    pick: '#logoPicker',
                                    resize : false,
                                    duplicate :true
                                    });
                            $(document).on('click', '.file-item', function(){
                            $(this).remove();
                            });
                        // 当有文件添加进来的时候
                            uploaderlogo.on('fileQueued', function(file) {
                            var $li = $(
                                    '<div id="' + file.id + '" class="file-item thumbnail">' +
                                    '<img>' +
                                    '<input type="hidden" value="" name="logo" id="logo">' +
                                    '<div class="info">' + file.name + '</div>' +
                                    '</div>'
                                    ),
                                    $img = $li.find('img');
                            // $list为容器jQuery实例
                            $("#logoList").html($li);
                            // 创建缩略图
                            // 如果为非图片文件，可以不用调用此方法。
                            // thumbnailWidth x thumbnailHeight 为 100 x 100
                            uploaderlogo.makeThumb(file, function(error, src) {
                            if (error) {
                            $img.replaceWith('<span>不能预览</span>');
                            return;
                            }

                            $img.attr('src', src);
                            }, 100, 100);
                            });
                        // 文件上传过程中创建进度条实时显示。
                            uploaderlogo.on('uploadProgress', function(file, percentage) {
                            var $li = $('#' + file.id),
                                    $percent = $li.find('.progress span');
                            // 避免重复创建
                            if (!$percent.length) {
                            $percent = $('<p class="progress"><span></span></p>')
                                    .appendTo($li)
                                    .find('span');
                            }

                            $percent.css('width', percentage * 100 + '%');
                            });
                        // 文件上传成功，给item添加成功class, 用样式标记上传成功。
                            uploaderlogo.on('uploadSuccess', function(file, response) {
                            $('#' + file.id).addClass('upload-state-done');
                            $("#logo").val(response._raw);
                            });
                        // 文件上传失败，显示上传出错。
                            uploaderlogo.on('uploadError', function(file) {
                            var $li = $('#' + file.id),
                                    $error = $li.find('div.error');
                            // 避免重复创建
                            if (!$error.length) {
                            $error = $('<div class="error"></div>').appendTo($li);
                            }

                            $error.text('上传失败');
                            });
                        // 完成上传完了，成功或者失败，先删除进度条。
                            uploaderlogo.on('uploadComplete', function(file) {
                            $('#' + file.id).find('.progress').remove();
                            });

                        </script>
                        <div class="form-group">
                            <label class="col-sm-3 control-label no-padding-right">具体地址：</label>
                            <div class="col-sm-9">
                                <input type="text"  value="<?=isset($detail->addr)?$detail->addr:''?>" placeholder="" id="addr" name="addr"  class="form-control" /> 
                            </div>
                        </div>
                         <div class="form-group">
                            <label class="col-sm-3 control-label no-padding-right">GPS定位地址：</label>
                            <div class="col-sm-9">
                                <input type="text"  value="<?=isset($detail->gps_addr)?$detail->gps_addr:''?>" placeholder="" id="gps_addr" name="gps_addr"  class="form-control" /> 
                            </div>
                        </div>
                           <div class="form-group">
                            <label class="col-sm-3 control-label no-padding-right"><span class="c-red">*</span>经度纬度：</label>
                            <div class="col-sm-3"  style="margin-right: 0; padding-right: 0;">
                                <input type="text" readonly style="background-color: transparent;" class="form-control"  value="<?=isset($detail->lat)?$detail->lat:'';?>" placeholder="" id="lat" name="lat"/>
                            </div>
                            <div class="col-sm-1" style="margin: 0;padding: 0;width: 1rem; line-height: 3rem">--</div>
                            <div class="col-sm-3" style="margin-left: 0; padding-left: 0;" >
                                <input type="text"  readonly style="background-color: transparent;" class="form-control" value="<?=isset($detail->lng)?$detail->lng:'';?>" placeholder="" id="lng" name="lng"/>
                            </div>
                            <div class="col-sm-2">
                                <button type="button"  mini="load" w="1000px" h="800px" href="<?=url('index/map',['callback'=>'showLatLng']);?>?lat=<?=isset($detail->lat)?$detail->lat:'0';?>&lng=<?=isset($detail->lng)?$detail->lng:'0';?>" class="btn btn-w-m btn-info">选择地址</button>
                            </div>
                            <script>
                                function showLatLng(lat, lng,addr) {
                                    layer.closeAll();
                                    layer.msg('选取经纬度成功！');
                                    $("#lat").val(lat);
                                    $("#lng").val(lng);
                                    $("#gps_addr").val(addr);
                                }
                            </script>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label no-padding-right">电话：</label>
                            <div class="col-sm-9">
                                <input type="text"  value="<?=isset($detail->tel)?$detail->tel:''?>" placeholder="" id="tel" name="tel"  class="form-control" /> 
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label no-padding-right">是否有WIFI：</label>
                            <div class="col-sm-9">        
                                <div class="radio i-checks">
                                    <label>
                                        <input name="is_wifi" id="is_wifi" value="1" type="radio" <?php if(isset($detail->is_wifi)&& $detail->is_wifi==1){?>checked="checked"<?php }?> > <i></i> 是</label>
                                    <label>
                                        <input name="is_wifi" id="is_wifi" value="0" type="radio" <?php if(isset($detail->is_wifi)&& $detail->is_wifi==0){?>checked="checked"<?php }?> > <i></i> 否</label>
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label no-padding-right">是否有停车场：</label>
                            <div class="col-sm-9">        
                                <div class="radio i-checks">
                                    <label>
                                        <input name="is_p" id="is_p" value="1" type="radio" <?php if(isset($detail->is_p)&& $detail->is_p==1){?>checked="checked"<?php }?> > <i></i> 是</label>
                                    <label>
                                        <input name="is_p" id="is_p" value="0" type="radio" <?php if(isset($detail->is_p)&& $detail->is_p==0){?>checked="checked"<?php }?> > <i></i> 否</label>
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label no-padding-right">微信支付：</label>
                            <div class="col-sm-9">        
                                <div class="radio i-checks">
                                    <label>
                                        <input name="is_weixin" id="is_weixin" value="1" type="radio" <?php if(isset($detail->is_weixin)&& $detail->is_weixin==1){?>checked="checked"<?php }?> > <i></i> 是</label>
                                    <label>
                                        <input name="is_weixin" id="is_weixin" value="0" type="radio" <?php if(isset($detail->is_weixin)&& $detail->is_weixin==0){?>checked="checked"<?php }?> > <i></i> 否</label>
                                </div>
                            </div>
                        </div>
                          <div class="form-group">
                            <label class="col-sm-3 control-label no-padding-right">支付宝支付：</label>
                            <div class="col-sm-9">        
                                <div class="radio i-checks">
                                    <label>
                                        <input name="is_alipay" id="is_alipay" value="1" type="radio" <?php if(isset($detail->is_alipay)&& $detail->is_alipay==1){?>checked="checked"<?php }?> > <i></i> 是</label>
                                    <label>
                                        <input name="is_alipay" id="is_alipay" value="0" type="radio" <?php if(isset($detail->is_alipay)&& $detail->is_alipay==0){?>checked="checked"<?php }?> > <i></i> 否</label>
                                </div>
                                并非小程序支持支付宝支付，而是店家是否支持！小程序只能支持微信支付
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label no-padding-right">营业时间：</label>
                            <div class="col-sm-9">
                                <input type="text"  value="<?=isset($detail->biz_t)?$detail->biz_t:''?>" placeholder="" id="biz_t" name="biz_t"  class="form-control" /> 营业时间
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label no-padding-right">介绍：</label>
                            <div class="col-sm-9">
                                <textarea  name="info" placeholder="说点什么...最少输入10个字符" id="info"  cols="50" rows="10" class="form-control"><?=isset($detail->info)?$detail->info:''?></textarea>
                                介绍
                            </div>
                        </div>

                        <div class="clearfix form-actions">
                            <div class="col-md-offset-3 col-md-9">
                                <button mini="submit" for="form-create" class="btn btn-info" type="button">
                                    <i class="ace-icon fa fa-check bigger-110"></i>
                                    保存
                                </button>

                            </div>
                        </div>
                    </form>

                </div></div>
        </div>
    </div>
</div>